package com.young.test.aop;

import javax.inject.Named;

import org.apache.log4j.Logger;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;


@Named
@Aspect
public class AfterThrowAdivce {

	
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(AfterReturnAdvice.class);

	@AfterThrowing(
			pointcut="com.young.test.aop.SystemArchitecture.forAspectBeanOperation() && com.young.test.aop.SystemArchitecture.forAllPublicMethod()",
			throwing="ex")
	public void throwAdvice(RuntimeException ex){
		logger.info("----Excetpion-----");
		logger.info(ex.getMessage());
		logger.info("----Excetpion end-----");
	}
	
}
